home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / util / cli / cliutils_mra.lha / Sources / pwd.a < prev    next >
Encoding:
Text File  |  1997-06-17  |  1.0 KB  |  65 lines

  1. ;
  2. ; pwd v1.0                                          * PD *
  3. ; written by Mauro Panigada
  4. ;
  5. ; $VER: pwd.a v1.0 (1996-12-19) by Mauro Panigada
  6. ;
  7. ; - Print Working Directory
  8. ;   A DOS program from UNIX (HP-UX, HP-9000 workstation, "Using HP-UX",
  9. ;   p. 5-6 Organizing Files in Directories, (c) 1987-1992 Hewlett-Packard
  10. ;   Company)
  11. ;
  12. ; Requirements: Need at least OS2.x.
  13. ;
  14.  
  15.         incdir    "dh0:progr/assem/include/"
  16.         include    "exec/types.i"
  17.         include    "exec/libraries.i"
  18.         include    "exec/exec_lib.i"
  19.         include    "dos/dos_lib.i"
  20.  
  21.  
  22.         bra.s    Start
  23.  
  24.         dc.b    "$VER: pwd v1.0 (1996-12-19) by Mauro Panigada",0
  25.         even
  26.  
  27. Start        lea    DOSName(pc),a1
  28.         moveq    #36,d0
  29.         move.l    4.w,a6
  30.         jsr    _LVOOpenLibrary(a6)
  31.         tst.l    d0
  32.         beq    Sayonara
  33.  
  34.         move.l    d0,a5
  35.         exg    a5,a6
  36.  
  37.         link    a4,#-264
  38.         move.l    sp,d1
  39.         move.l    #256,d2
  40.         jsr    _LVOGetCurrentDirName(a6)
  41.  
  42.         move.l    sp,a0
  43. Loop        tst.b    (a0)+
  44.         bne.s    Loop
  45.         move.b    #10,-1(a0)
  46.         clr.b    (a0)
  47.  
  48.         move.l    sp,d1
  49.         jsr    _LVOPutStr(a6)
  50.  
  51.         unlk    a4
  52.  
  53.         exg    a5,a6
  54.         move.l    a5,a1
  55.         jsr    _LVOCloseLibrary(a6)
  56.  
  57. Sayonara    moveq    #0,d0
  58.         rts
  59.  
  60.  
  61. DOSName        dc.b    "dos.library",0
  62.         even
  63.  
  64.  
  65.         END